<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>插槽作用域</title>
</head>
<body>
<div id="app">
    <cpn></cpn>
    <hr>
    <cpn>
        <button>abc</button>
    </cpn>

    <hr>

    <cpn>
        <template v-slot="scope">
            <!--<div>{{ scope }}</div>-->
            <div>{{ scope.info }}</div>
            <div>{{ scope.grate }}</div>
        </template>
    </cpn>
</div>

<template id="cpn">
    <h1>世界，您好！</h1>
    <slot info="Hello, World!" grate="陕西人民欢迎您！"></slot>
</template>

<script type="module">
    import {createApp} from "../../../../js/vue.esm-browser.js";
    import {defineComponent} from "../../../../js/vue.esm-browser.js";

    let cpn = defineComponent(
        {
            template: "#cpn",

        }
    );


    let app = createApp(
        {
            setup() {

            },
            components: {
                cpn
            }
        }
    )

    app.mount("#app")
</script>
</body>
</html>